﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp18
{
    class STUDENT
    {
        private int id;
        private string name;
        private int age;
        public int Id { get; set; }
        public string Name { get; set; }
        public int Age
        {
            get { return this.age; }
            set
            {
                if (value<0||value>128)
                {
                    age = 0;
                }
                else
                {
                    age = value;
                }
            }
         }

        public STUDENT(int id, string name, int age)
        {
            Id = id;
            Name = name;
            Age = age;
            Id = id;
            Name = name;
            Age = age;
        }

        public void hello() 
        {
            Console.WriteLine("学号{0}，名字{1}，年龄{2}",this.Id,this.Name,this.Age);
        }
    }
}
